#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
#include <QtQml>
#include <QGuiApplication>
#include <sailfishapp.h>
#include "service/novelservice.h"
#include "database/DatabaseConnection.h"

int main(int argc, char *argv[])
{

    QGuiApplication app(argc, argv);

    // 初始化数据库（类似Java的static块）
    DatabaseConnection::initialize();

    // 注册Service到QML（类似Spring的依赖注入）
    qmlRegisterType<NovelService>("com.novel.service", 1, 0, "NovelService");

    return SailfishApp::main(argc, argv);
}
